package org.example.controller;

import org.example.domain.Person;
import org.example.service.TestService;
import org.example.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: WangShengJie
 * @Date: 2025/4/21
 */
@RestController
@RequestMapping("/test")
public class TestController {

    @Autowired
    private TestService testService;

    /**
     * 测试方法监听器的Controller
     * @param person person
     * @return JsonResult
     */
    @RequestMapping("/methodListenerTest")
    @ResponseBody
    public JsonResult methodListenerTest(@RequestBody Person person) {
        return testService.methodListenerTest(person);
    }
}
